Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum


  

PreviousPrevious NextNext


~Fred Xanjumimarakoi 10.Sep.03 02:07 PM a Web browser
Domino Designer 6.0.2 CF1 Windows XP


I found some threads in the 4&5 Forum (http://www-10.lotus.com/ldd/46dom.nsf/55c38d716d632d9b8525689b005ba1c0/de00d1befd0617cf85256a45005b9d34?OpenDocument&Highlight=0,gotof%3Feld), tried the ideas/solutions, but I still get the same error: "Cannot locate field."

I have copied a script routine from Lotus' Microsoft Office Library Template and am using it in my own database. The routine is from the "OLERoutines" script library called "GetOrCreateOLEObject."

I have copied over the fields from the Form called "MS Office Document\New Word Document" in this template into my form in my database, not changing a thing. I copied a few from the Subform "DocumentWorkflow" also.

The script works fine with the template, however, when I run it in my database, I continually get the error: "Cannot locate field" when it hits a certain point.

Here is my script:
1. 'Let's check to make sure the doc is in Edit Mode..
2. If doc.EditMode = True Then
3. Else
4. doc.EditMode = True
5. End If

6. If note.HasItem("$OLEObjProgID") Then
7. sOleField = note.~$OLEObjField(0)
8. If doc.IsNewDoc Then
9. note.~$OLEVersion = "46"
10. doc.RefreshHideFormulas
11. doc.GotoField(sOleField)
12. Set oleobject = doc.CreateObject("OLEObject",note.~$OLEObjProgID(0),"")
13. Call oleobject.Range().InsertFile(LetterFilePath)
14. Else
15. 'Let's exit if the doc is being accessed through the Preview Pane...
16. If doc.InPreviewPane = True Then
17. Exit Sub
18. End If
19. 'Let's check to see if the doc has an embedded object...
20. If note.HasEmbedded = True Then
21. Set rtitem = note.GetFirstItem(sOleField)
22. Set embed = rtitem.EmbeddedObjects(0)
23. 'Let's see if this is an older document...
24. If note.~$OLEVersion(0) <> "46" Then
25. Set oleobject = embed.Activate(True)
26. Else
27. Set oleobject = doc.GetObject(embed.name)
28. End If
29. Else
30. 'Let's create the Word doc, since there is no embedded object..
31. If doc.EditMode = True Then
32. doc.GotoField(sOleField)
33. 'Call doc.CreateObject("OLEObject",note.~$OLEObjProgID(0),"")
34. Set oleobject = doc.CreateObject("OLEObject",note.~$OLEObjProgID(0),"")
35. Call oleobject.Range().InsertFile(LetterFilePath)
36. End If
37. End If
38. End If
39. End If

Line 32 (it is looking for a rich text field called "Body") is where the error continually occurs. I am opening an existing document - one that already has an embedded object on it.

The doc (UIDoc) is in Edit Mode. I do not have any sections on this form.

The rich text field "Body" does exist on the form and contains the same HideWhen formulas that were in the template.

Thanks!
Dan






"Cannot Locate Field" using uidoc.G... (~Fred Xanjumima... 10.Sep.03)
. . RE: "Cannot Locate Field" using uid... (~Delores Dwonic... 10.Sep.03)
. . . . RE: "Cannot Locate Field" using uid... (~Fred Xanjumima... 10.Sep.03)
. . . . . . RE: "Cannot Locate Field" using uid... (~Delores Dwonic... 10.Sep.03)
. . . . . . . . What I have found out... (~Fred Xanjumima... 10.Sep.03)





  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Category
Platform
Release
Advanced search

 RSS feedsRSS
All forum posts RSS
All main topics RSS